{
  Среда автоматизированного моделирования (метамоделирования)

 Эта программа распространяется без каких-либо гарантий в надежде, что она
 окажется кому-нибудь полезной.

   версия 0.2 март 2011 prodg@ya.ru D.Kondakov
}
program IIntegral;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cmem,
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  SysUtils, FileUtil, Forms, MultiThreadProcsLaz, luicomponents, luicontrols,
  luiconfigtree_pkg, vtvutils_package, virtualdbgrid_package, IIntgrlTypes,
  IIntgrlBaseDefs, IIntgrlBaseParms, IIntgrlBaseCnfg, IIntgrlDBPlgn, WrkspcCfgrtn,
  IIntgrlObjcts, CalcObjcts, LogSystm, DataMngrSystm, ExctnSystm, SolvingSystm,
  PreProcssr, StrngParsrs, DataObjcts, RefrncDtaSystm, ExcSysObjcts, ScrptObjcts,
  IntgrlMainForm, DataViewFormUnit, GVEditorFormUnit, ExctnSystmFormUnit,
  LogViewFormUnit, ParamsFormUnit, LibViewFormUnit, DataMiner, DataHistSystm,
  HistViewFormUnit, UsersMngrSystm, IIntgrlAccuracy, CommandConsole,
  ObjectVEFrameUnit, ScriptVEFrameUnit, SchemaVEFrameUnit, AboutFormUnit, 
IIntgrlWrkspc, StrDefList;

{$R *.res}

{$i calcconfig.inc}

var
  s: string;

begin
  Application.Title := 'IIntegrall';

// Выводим информацию о параметрах командной строки
  s := ParamStrUTF8(1);
  if (s = '--help')or(s = '-h') then begin
    writeln(StdOut, ' Options:');
    writeln(StdOut, b3 + '-h, --help' + tb  + tb + tb + hlpHelp);
    writeln(StdOut, b3 + '-c, --context="CONTEXT_NAME"' + tb + hlpContext);
    writeln(StdOut, b3 + '-v, --version' + tb  + tb + hlpVersion);
    writeln(StdOut, b3 + '-l, --log="LOG_OUTPUT"' + tb + hlpLog);
    exit;
  end else if (s = '--version')or(s = '-v') then begin
    s := b + pstVer + b;
    writeln(StdOut, b2 + DBmodName + s + v2s(DBmodVer));
    writeln(StdOut, b2 + EXECmodName + s + v2s(EXECmodVer));
    writeln(StdOut, b2 + LIBmodName + s + v2s(LIBmodVer));
    {$ifdef iiHistory}writeln(StdOut, b2 + HISTmodName + s + v2s(HISTmodVer));{$endif}
    {$ifdef iiMultiUser}writeln(StdOut, b2 + ACCNTmodName + s + v2s(ACCNTmodVer));{$endif}
    writeln(StdOut, b2 + SOLVmodName + s + v2s(SOLVmodVer));
    writeln(StdOut, b2 + ENVmodName + s + v2s(ENVmodVer));
    exit;
  end;

  IIntegralConfig := TIntgrlCfgrtn.Create;

  Application.Initialize;
  Application.CreateForm(TIntegralMainForm, IntegralMainForm);
  Application.CreateForm(TParamsForm, ParamsForm);
  Application.CreateForm(TLogViewForm, LogViewForm);
  Application.CreateForm(TLibViewForm, LibViewForm);
  Application.CreateForm(TDataViewForm, DataViewForm);
  Application.CreateForm(TExctnSystmForm, ExctnSystmForm);
  Application.CreateForm(THistViewForm, HistViewForm);
  Application.CreateForm(TGVeditForm, GVeditForm);
  Application.CreateForm(TAboutForm, AboutForm);
  Application.Run;

  IIntegralConfig.Free;
end.

